<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"><title>今日水印相机自定义水印 | Forgo7ten'blog</title><meta name="keywords" content="Android逆向"><meta name="author" content="Forgo7ten"><meta name="copyright" content="Forgo7ten"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="今日水印相机自定义水印 ¶  @app_version：v2.8.19.10 今日水印相机_v2.8.19.10-E6F9CE50D9CC85A5FD433DD1FEE1F863 Download apk没有加壳，还是比较好分析的 抓包 ¶  打开app开始抓包，有以下几个api  逆向分析 ¶  分析天气参数的获取 ¶  jeb分析 ¶  jeb中搜索相应的URI  选择第二个来到 一个所有re">
<meta property="og:type" content="article">
<meta property="og:title" content="今日水印相机自定义水印">
<meta property="og:url" content="https://forgo7ten.github.io/AndroidReverse/2021/Crack_com.xhey.xcamera/index.html">
<meta property="og:site_name" content="Forgo7ten&#39;blog">
<meta property="og:description" content="今日水印相机自定义水印 ¶  @app_version：v2.8.19.10 今日水印相机_v2.8.19.10-E6F9CE50D9CC85A5FD433DD1FEE1F863 Download apk没有加壳，还是比较好分析的 抓包 ¶  打开app开始抓包，有以下几个api  逆向分析 ¶  分析天气参数的获取 ¶  jeb分析 ¶  jeb中搜索相应的URI  选择第二个来到 一个所有re">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="http://forgo7ten.gitee.io/store/imgs/17.jpg">
<meta property="article:published_time" content="2021-08-09T16:00:00.000Z">
<meta property="article:modified_time" content="2021-08-09T16:00:00.000Z">
<meta property="article:author" content="Forgo7ten">
<meta property="article:tag" content="Android逆向">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="http://forgo7ten.gitee.io/store/imgs/17.jpg"><link rel="shortcut icon" href="/images/favicon.jpg"><link rel="canonical" href="https://forgo7ten.github.io/AndroidReverse/2021/Crack_com.xhey.xcamera/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//hm.baidu.com"/><link rel="preconnect" href="//www.clarity.ms"/><link rel="preconnect" href="//fonts.googleapis.com" crossorigin=""/><link rel="preconnect" href="//busuanzi.ibruce.info"/><meta name="google-site-verification" content="8L0ZjthONyq6-m7FniRTH8A7Bh0x-KOPZbKOcNimnYA"/><meta name="baidu-site-verification" content="code-gjVsyPt7yr"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.css" media="print" onload="this.media='all'"><script>var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "https://hm.baidu.com/hm.js?b076845d73a4f28b3c7401b2a0a8a9db";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script><script>(function(c,l,a,r,i,t,y){
    c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
    t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;
    y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
})(window, document, "clarity", "script", "9zbibmmffi");</script><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Titillium+Web&amp;display=swap" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = { 
  root: '/',
  algolia: undefined,
  localSearch: {"path":"search.xml","languages":{"hits_empty":"找不到您查询的内容：${query}"}},
  translate: {"defaultEncoding":2,"translateDelay":0,"msgToTraditionalChinese":"繁","msgToSimplifiedChinese":"簡"},
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":300},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: true,
    post: false
  },
  runtime: '天',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: {"chs_to_cht":"你已切换为繁体","cht_to_chs":"你已切换为简体","day_to_night":"你已切换为深色模式","night_to_day":"你已切换为浅色模式","bgLight":"#49b1f5","bgDark":"#121212","position":"bottom-left"},
  source: {
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery@2/dist/fjGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery@2/dist/fjGallery.min.css'
    }
  },
  isPhotoFigcaption: false,
  islazyload: true,
  isAnchor: true
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: '今日水印相机自定义水印',
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2021-08-10 00:00:00'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          if (t === 'dark') activateDarkMode()
          else if (t === 'light') activateLightMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
    const detectApple = () => {
      if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
        document.documentElement.classList.add('apple')
      }
    }
    detectApple()
    })(window)</script><meta name="generator" content="Hexo 5.4.0"><link rel="alternate" href="/atom.xml" title="Forgo7ten'blog" type="application/atom+xml">
</head><body><div id="loading-box"><div class="loading-left-bg"></div><div class="loading-right-bg"></div><div class="spinner-box"><div class="configure-border-1"><div class="configure-core"></div></div><div class="configure-border-2"><div class="configure-core"></div></div><div class="loading-word">加载中...</div></div></div><div id="web_bg"></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="/images/avatar.jpg" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="site-data is-center"><div class="data-item"><a href="/archives/"><div class="headline">文章</div><div class="length-num">20</div></a></div><div class="data-item"><a href="/tags/"><div class="headline">标签</div><div class="length-num">8</div></a></div><div class="data-item"><a href="/categories/"><div class="headline">分类</div><div class="length-num">6</div></a></div></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fas fa-compass"></i><span> 目录</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 归档</span></a></li><li><a class="site-page child" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></li><li><a class="site-page child" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/atom.xml"><i class="fa-fw fa fa-rss"></i><span> RSS订阅</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div><div class="menus_item"><a class="site-page" href="/messageboard/"><i class="fa-fw fas fa-comment-dots"></i><span> 留言板</span></a></div></div></div></div><div class="post" id="body-wrap"><header class="post-bg" id="page-header" style="background-image: url('http://forgo7ten.gitee.io/store/imgs/17.jpg')"><nav id="nav"><span id="blog_name"><a id="site-name" href="/">Forgo7ten'blog</a></span><div id="menus"><div id="search-button"><a class="site-page social-icon search"><i class="fas fa-search fa-fw"></i><span> 搜索</span></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fas fa-compass"></i><span> 目录</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 归档</span></a></li><li><a class="site-page child" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></li><li><a class="site-page child" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/atom.xml"><i class="fa-fw fa fa-rss"></i><span> RSS订阅</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div><div class="menus_item"><a class="site-page" href="/messageboard/"><i class="fa-fw fas fa-comment-dots"></i><span> 留言板</span></a></div></div><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="post-info"><h1 class="post-title">今日水印相机自定义水印</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2021-08-09T16:00:00.000Z" title="发表于 2021-08-10 00:00:00">2021-08-10</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2021-08-09T16:00:00.000Z" title="更新于 2021-08-10 00:00:00">2021-08-10</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/categories/Android%E9%80%86%E5%90%91/">Android逆向</a><i class="fas fa-angle-right post-meta-separator"></i><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/categories/Android%E9%80%86%E5%90%91/%E5%B0%8F%E5%B1%95%E8%BA%AB%E6%89%8B/">小展身手</a></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-wordcount"><i class="far fa-file-word fa-fw post-meta-icon"></i><span class="post-meta-label">字数总计:</span><span class="word-count">2k</span><span class="post-meta-separator">|</span><i class="far fa-clock fa-fw post-meta-icon"></i><span class="post-meta-label">阅读时长:</span><span>10分钟</span></span><span class="post-meta-separator">|</span><span class="post-meta-pv-cv" id="" data-flag-title="今日水印相机自定义水印"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">阅读量:</span><span id="busuanzi_value_page_pv"></span></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><h1 id="今日水印相机自定义水印">今日水印相机自定义水印<a class="header-anchor" href="#今日水印相机自定义水印"> ¶ </a></h1>
<p>@app_version：v2.8.19.10</p>
<p><a target="_blank" rel="noopener" href="https://wwx.lanzoui.com/i8KE0sgl02h">今日水印相机_v2.8.19.10-E6F9CE50D9CC85A5FD433DD1FEE1F863 Download</a></p>
<p>apk没有加壳，还是比较好分析的</p>
<h2 id="抓包">抓包<a class="header-anchor" href="#抓包"> ¶ </a></h2>
<p>打开app开始抓包，有以下几个api</p>
<p><img src= "" data-lazy-src="/AndroidReverse/2021/Crack_com.xhey.xcamera/image-20210810004740692.png" alt="image-20210810004740692"></p>
<h2 id="逆向分析">逆向分析<a class="header-anchor" href="#逆向分析"> ¶ </a></h2>
<h3 id="分析天气参数的获取">分析天气参数的获取<a class="header-anchor" href="#分析天气参数的获取"> ¶ </a></h3>
<h4 id="jeb分析">jeb分析<a class="header-anchor" href="#jeb分析"> ¶ </a></h4>
<p>jeb中搜索相应的URI</p>
<p><img src= "" data-lazy-src="/AndroidReverse/2021/Crack_com.xhey.xcamera/image-20210810004938096.png" alt="image-20210810004938096"></p>
<p>选择第二个来到 一个所有request方法的类</p>
<p><img src= "" data-lazy-src="/AndroidReverse/2021/Crack_com.xhey.xcamera/image-20210810005040994.png" alt="image-20210810005040994"></p>
<p>摁X进行交叉引用</p>
<p>参数1和参数2即为经纬度坐标</p>
<p><img src= "" data-lazy-src="/AndroidReverse/2021/Crack_com.xhey.xcamera/image-20210810005122554.png" alt="image-20210810005122554"></p>
<p>来到这里</p>
<p><img src= "" data-lazy-src="/AndroidReverse/2021/Crack_com.xhey.xcamera/image-20210810005156768.png" alt="image-20210810005156768"></p>
<p>发现内部类对其进行了解析，强转为<code>WeatherInfo</code></p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">public</span> <span class="class"><span class="keyword">class</span> <span class="title">WeatherInfo</span> </span>&#123;</span><br><span class="line">    <span class="keyword">public</span> String apparentTemperature; <span class="comment">// 体感温度：30</span></span><br><span class="line">    <span class="keyword">public</span> String aqi;   <span class="comment">// 空气质量指数：37</span></span><br><span class="line">    <span class="keyword">public</span> String aqiLevel; <span class="comment">// 空气质量等级：优</span></span><br><span class="line">    <span class="keyword">public</span> String humidity; <span class="comment">// 湿度：75%</span></span><br><span class="line">    <span class="keyword">public</span> String pressure; <span class="comment">// 压强：1001</span></span><br><span class="line">    <span class="keyword">public</span> String temperature; <span class="comment">// 温度：27</span></span><br><span class="line">    <span class="keyword">public</span> String weather; <span class="comment">// 天气：晴</span></span><br><span class="line">    <span class="keyword">public</span> String winddirection; <span class="comment">// 风向：西南风</span></span><br><span class="line">    <span class="keyword">public</span> String windpower; <span class="comment">// 风力：1级</span></span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p>接下来就是如何hook该内部类了</p>
<h4 id="调试验证">调试验证<a class="header-anchor" href="#调试验证"> ¶ </a></h4>
<p>运行fridaserver</p>
<p>使用frida的objection工具</p>
<p>先启动目标app</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">objection -N -h 192.168.0.104 -p 8888 -d -g com.xhey.xcamera explore</span><br></pre></td></tr></table></figure>
<p>然后查找<code>com.xhey.xcamera.e</code>的类</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">com.xhey.xcamera on (google: 8.1.0) [net] <span class="comment"># android hooking search classes com.xhey.xcamera.e                                                       </span></span><br><span class="line">com.xhey.xcamera.e</span><br><span class="line">com.xhey.xcamera.e<span class="variable">$1</span></span><br><span class="line">com.xhey.xcamera.e<span class="variable">$5</span></span><br><span class="line">com.xhey.xcamera.e<span class="variable">$6</span></span><br><span class="line">com.xhey.xcamera.e<span class="variable">$8</span></span><br><span class="line">com.xhey.xcamera.e<span class="variable">$a</span></span><br><span class="line">com.xhey.xcamera.e<span class="variable">$b</span></span><br><span class="line"></span><br><span class="line">Found 7 classes</span><br></pre></td></tr></table></figure>
<p>挨个查看每个内部类的方法</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">com.xhey.xcamera on (google: 8.1.0) [net] <span class="comment"># android hooking list class_methods com.xhey.xcamera.e$1                                                 </span></span><br><span class="line">private static void com.xhey.xcamera.e<span class="variable">$1</span>.b(xhey.com.network.model.BaseResponse)</span><br><span class="line">public static void com.xhey.xcamera.e<span class="variable">$1</span>.lambda<span class="variable">$Wc1CpEPvMWi1606k4HUcLAjQgiw</span>(xhey.com.network.model.BaseResponse)</span><br><span class="line">public void com.xhey.xcamera.e<span class="variable">$1</span>.a(xhey.com.network.model.BaseResponse&lt;com.xhey.xcamera.data.model.bean.ConfigStatus&gt;)</span><br><span class="line">public void com.xhey.xcamera.e<span class="variable">$1</span>.onError(java.lang.Throwable)</span><br><span class="line">public void com.xhey.xcamera.e<span class="variable">$1</span>.onSuccess(java.lang.Object)</span><br><span class="line"></span><br><span class="line">Found 5 method(s)</span><br></pre></td></tr></table></figure>
<p>发现<code>e$1</code>,<code>e$5</code>,<code>e$8</code>具有相同的方法，且与上反编译源码中方法类似</p>
<figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><span class="line"><span class="function"><span class="keyword">function</span> <span class="title">main</span>(<span class="params"></span>)</span>&#123;</span><br><span class="line">    Java.perform(<span class="function"><span class="keyword">function</span> (<span class="params"></span>) </span>&#123;</span><br><span class="line">        <span class="keyword">var</span> clazz = Java.use(<span class="string">&#x27;com.xhey.xcamera.e$5&#x27;</span>);</span><br><span class="line">        clazz.a.implementation = <span class="function"><span class="keyword">function</span> (<span class="params">response_argu</span>) </span>&#123;</span><br><span class="line">            <span class="keyword">var</span> result = clazz.a.apply(<span class="built_in">this</span>, <span class="built_in">arguments</span>);</span><br><span class="line">            <span class="keyword">var</span> response = Java.cast(response_argu, Java.use(<span class="string">&quot;xhey.com.network.model.BaseResponse&quot;</span>));</span><br><span class="line">            <span class="built_in">console</span>.log(<span class="string">&quot;BaseResponse.code&quot;</span>, response.code.value);</span><br><span class="line">            <span class="built_in">console</span>.log(<span class="string">&quot;BaseResponse.data&quot;</span>, response.data.value);</span><br><span class="line">            <span class="built_in">console</span>.log(<span class="string">&quot;BaseResponse.msg&quot;</span>, response.msg.value);</span><br><span class="line">            <span class="built_in">console</span>.log(<span class="string">&quot;BaseResponse.toast_msg&quot;</span>, response.toast_msg.value);</span><br><span class="line">            <span class="keyword">return</span> result;</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;);</span><br><span class="line">&#125;</span><br><span class="line">setImmediate(main)</span><br></pre></td></tr></table></figure>
<p>frida来运行调试</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">frida -H 192.168.0.104:8888 -f com.xhey.xcamera -l syxj.js --no-pause</span><br></pre></td></tr></table></figure>
<p>打印出如下信息</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">[Remote::com.xhey.xcamera]-&gt; BaseResponse.code 200</span><br><span class="line">BaseResponse.data com.xhey.xcamera.data.model.bean.WeatherInfo@1d5fef8</span><br><span class="line">BaseResponse.msg success</span><br><span class="line">BaseResponse.toast_msg </span><br></pre></td></tr></table></figure>
<p>发现WeatherInfo，就是解密后的类</p>
<h3 id="分析时间的获取">分析时间的获取<a class="header-anchor" href="#分析时间的获取"> ¶ </a></h3>
<p>部分同天气获取，定位到</p>
<p><img src= "" data-lazy-src="/AndroidReverse/2021/Crack_com.xhey.xcamera/image-20210810012037704.png" alt="image-20210810012037704"></p>
<p>其中<code>v1.build()</code>调用了aes，来对json字符串进行加密</p>
<p><img src= "" data-lazy-src="/AndroidReverse/2021/Crack_com.xhey.xcamera/image-20210810012124362.png" alt="image-20210810012124362"></p>
<p>得到key和iv均为<code>&quot;xhey-cc4275fd-43&quot;</code>，AES模式为<code>&quot;AES/CBC/PKCS5Padding&quot;</code></p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">package</span> xhey.com.network.retrofit2;</span><br><span class="line"><span class="keyword">public</span> <span class="class"><span class="keyword">enum</span> <span class="title">AESUtil</span> </span>&#123;</span><br><span class="line">    <span class="keyword">private</span> <span class="keyword">static</span> <span class="keyword">final</span> String ENCRYPTION_IV = <span class="string">&quot;xhey-cc4275fd-43&quot;</span>;</span><br><span class="line">    <span class="keyword">private</span> <span class="keyword">static</span> <span class="keyword">final</span> String ENCRYPTION_KEY = <span class="string">&quot;xhey-cc4275fd-43&quot;</span>;</span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">static</span> String <span class="title">decrypt</span><span class="params">(String arg4)</span> </span>&#123;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">static</span> String <span class="title">encrypt</span><span class="params">(String arg5)</span> </span>&#123;</span><br><span class="line">        <span class="keyword">if</span>(TextUtils.isEmpty(arg5)) &#123;</span><br><span class="line">            <span class="keyword">return</span> arg5;</span><br><span class="line">        &#125;</span><br><span class="line"></span><br><span class="line">        <span class="keyword">try</span> &#123;</span><br><span class="line">            Cipher v0 = Cipher.getInstance(<span class="string">&quot;AES/CBC/PKCS5Padding&quot;</span>);</span><br><span class="line">            v0.init(<span class="number">1</span>, AESUtil.makeKey(), AESUtil.makeIv());</span><br><span class="line">            Log.e(<span class="string">&quot;time&quot;</span>, <span class="string">&quot;==&quot;</span> + Base64.encode(v0.doFinal(arg5.getBytes()), <span class="number">0</span>));</span><br><span class="line">            <span class="keyword">return</span> <span class="keyword">new</span> String(Base64.encode(v0.doFinal(arg5.getBytes()), <span class="number">2</span>)).trim();</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">catch</span>(Exception v5) &#123;</span><br><span class="line">            Log.e(<span class="string">&quot;AESUtil&quot;</span>, <span class="string">&quot;=encrypt=&quot;</span> + v5.getMessage());</span><br><span class="line">            <span class="keyword">return</span> <span class="string">&quot;&quot;</span>;</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">static</span> AlgorithmParameterSpec <span class="title">makeIv</span><span class="params">()</span> </span>&#123;</span><br><span class="line">        <span class="keyword">return</span> <span class="keyword">new</span> IvParameterSpec(<span class="string">&quot;xhey-cc4275fd-43&quot;</span>.getBytes(<span class="string">&quot;utf-8&quot;</span>));</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">static</span> SecretKeySpec <span class="title">makeKey</span><span class="params">()</span> </span>&#123;</span><br><span class="line">        <span class="keyword">return</span> <span class="keyword">new</span> SecretKeySpec(<span class="string">&quot;xhey-cc4275fd-43&quot;</span>.getBytes(<span class="string">&quot;utf-8&quot;</span>), <span class="string">&quot;AES&quot;</span>);</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p>此时我们就可以对Fiddler抓到的包来进行加解密了。</p>
<p><code>requestTimeInChina</code>继续查看上层引用，同样来到了<code>com.xhey.xcamera.e</code>类中</p>
<p><img src= "" data-lazy-src="/AndroidReverse/2021/Crack_com.xhey.xcamera/image-20210810012605219.png" alt="image-20210810012605219"></p>
<p>同样frida分析后发现是<code>e$8</code></p>
<h3 id="分析定位">分析定位<a class="header-anchor" href="#分析定位"> ¶ </a></h3>
<p>当程序获取天气参数的时候，使用了定位</p>
<p>交叉引用向上追溯</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">com.xhey.xcamera.network.service.NetWorkServiceKt.requestWeatherInfo</span><br><span class="line">com.xhey.xcamera.e.b(java.lang.String[])+2Ah</span><br><span class="line">com.xhey.xcamera.e.a(boolean, com.baidu.location.BDLocation)+5D8h</span><br></pre></td></tr></table></figure>
<p>找到赋值的地方</p>
<p><img src= "" data-lazy-src="/AndroidReverse/2021/Crack_com.xhey.xcamera/image-20210810013246491.png" alt="image-20210810013246491"></p>
<p>hook这两个方法就可以修改经纬度也就是定位了</p>
<p>而BDLocation是百度地图的api</p>
<p>同理速度也可以hook<code>BDLocation.getSpeed</code>来修改</p>
<h2 id="插件编写">插件编写<a class="header-anchor" href="#插件编写"> ¶ </a></h2>
<h3 id="Frida-hook脚本">Frida hook脚本<a class="header-anchor" href="#Frida-hook脚本"> ¶ </a></h3>
<figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br><span class="line">140</span><br><span class="line">141</span><br><span class="line">142</span><br><span class="line">143</span><br><span class="line">144</span><br><span class="line">145</span><br><span class="line">146</span><br><span class="line">147</span><br><span class="line">148</span><br><span class="line">149</span><br><span class="line">150</span><br><span class="line">151</span><br><span class="line">152</span><br><span class="line">153</span><br><span class="line">154</span><br><span class="line">155</span><br><span class="line">156</span><br><span class="line">157</span><br><span class="line">158</span><br><span class="line">159</span><br><span class="line">160</span><br><span class="line">161</span><br><span class="line">162</span><br><span class="line">163</span><br><span class="line">164</span><br><span class="line">165</span><br><span class="line">166</span><br><span class="line">167</span><br><span class="line">168</span><br><span class="line">169</span><br><span class="line">170</span><br><span class="line">171</span><br><span class="line">172</span><br></pre></td><td class="code"><pre><span class="line"><span class="function"><span class="keyword">function</span> <span class="title">printStack</span>(<span class="params">name</span>) </span>&#123;</span><br><span class="line">    Java.perform(<span class="function"><span class="keyword">function</span> (<span class="params"></span>) </span>&#123;</span><br><span class="line">        <span class="keyword">var</span> Exception = Java.use(<span class="string">&quot;java.lang.Exception&quot;</span>);</span><br><span class="line">        <span class="keyword">var</span> ins = Exception.$new(<span class="string">&quot;Exception&quot;</span>);</span><br><span class="line">        <span class="keyword">var</span> straces = ins.getStackTrace();</span><br><span class="line">        <span class="keyword">if</span> (straces != <span class="literal">undefined</span> &amp;&amp; straces != <span class="literal">null</span>) &#123;</span><br><span class="line">            <span class="keyword">var</span> strace = straces.toString();</span><br><span class="line">            <span class="keyword">var</span> replaceStr = strace.replace(<span class="regexp">/,/g</span>, <span class="string">&quot;\\n&quot;</span>);</span><br><span class="line">            <span class="built_in">console</span>.log(<span class="string">&quot;=============================&quot;</span> + name + <span class="string">&quot; Stack strat=======================&quot;</span>);</span><br><span class="line">            <span class="built_in">console</span>.log(replaceStr);</span><br><span class="line">            <span class="built_in">console</span>.log(<span class="string">&quot;=============================&quot;</span> + name + <span class="string">&quot; Stack end=======================\r\n&quot;</span>);</span><br><span class="line">            Exception.$dispose();</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;);</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">function</span> <span class="title">main</span>(<span class="params"></span>) </span>&#123;</span><br><span class="line"></span><br><span class="line">    Java.perform(<span class="function"><span class="keyword">function</span> (<span class="params"></span>) </span>&#123;</span><br><span class="line">        <span class="comment">/**</span></span><br><span class="line"><span class="comment">         * 解析 /next/android/config</span></span><br><span class="line"><span class="comment">         */</span></span><br><span class="line">        <span class="keyword">var</span> clazz = Java.use(<span class="string">&#x27;com.xhey.xcamera.e$1&#x27;</span>);</span><br><span class="line">        clazz.a.implementation = <span class="function"><span class="keyword">function</span> (<span class="params">response_argu</span>) </span>&#123;</span><br><span class="line">            <span class="keyword">var</span> response = Java.cast(response_argu, Java.use(<span class="string">&quot;xhey.com.network.model.BaseResponse&quot;</span>));</span><br><span class="line">            <span class="comment">// console.log(&quot;BaseResponse.code&quot;,response.code.value);</span></span><br><span class="line">            <span class="comment">// console.log(&quot;BaseResponse.data&quot;,response.data.value);</span></span><br><span class="line">            <span class="comment">// console.log(&quot;BaseResponse.msg&quot;,response.msg.value);</span></span><br><span class="line">            <span class="comment">// console.log(&quot;BaseResponse.toast_msg&quot;,response.toast_msg.value);</span></span><br><span class="line"></span><br><span class="line">            <span class="keyword">var</span> result = clazz.a.apply(<span class="built_in">this</span>, <span class="built_in">arguments</span>);</span><br><span class="line">            <span class="keyword">return</span> result;</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;);</span><br><span class="line"></span><br><span class="line">    Java.perform(<span class="function"><span class="keyword">function</span> (<span class="params"></span>) </span>&#123;</span><br><span class="line">        Java.openClassFile(<span class="string">&quot;/data/local/tmp/r0gson.dex&quot;</span>).load();</span><br><span class="line">        <span class="keyword">const</span> gson = Java.use(<span class="string">&#x27;com.r0ysue.gson.Gson&#x27;</span>);</span><br><span class="line">        <span class="comment">/**</span></span><br><span class="line"><span class="comment">         * 解析天气 /next/GetCurrentWeather</span></span><br><span class="line"><span class="comment">         * public class WeatherInfo &#123;</span></span><br><span class="line"><span class="comment">         *      public String apparentTemperature; // 体感温度：30</span></span><br><span class="line"><span class="comment">         *      public String aqi;   // 空气质量指数：37</span></span><br><span class="line"><span class="comment">         *      public String aqiLevel; // 空气质量等级：优</span></span><br><span class="line"><span class="comment">         *      public String humidity; // 湿度：75%</span></span><br><span class="line"><span class="comment">         *      public String pressure; // 压强：1001</span></span><br><span class="line"><span class="comment">         *      public String temperature; // 温度：27</span></span><br><span class="line"><span class="comment">         *      public String weather; // 天气：晴</span></span><br><span class="line"><span class="comment">         *      public String winddirection; // 风向：西南风</span></span><br><span class="line"><span class="comment">         *      public String windpower; // 风力：1级</span></span><br><span class="line"><span class="comment">         * &#125;</span></span><br><span class="line"><span class="comment">         */</span></span><br><span class="line">        <span class="keyword">var</span> clazz = Java.use(<span class="string">&#x27;com.xhey.xcamera.e$5&#x27;</span>);</span><br><span class="line">        clazz.a.implementation = <span class="function"><span class="keyword">function</span> (<span class="params">response_argu</span>) </span>&#123;</span><br><span class="line">            <span class="keyword">var</span> response = Java.cast(response_argu, Java.use(<span class="string">&quot;xhey.com.network.model.BaseResponse&quot;</span>));</span><br><span class="line">            <span class="keyword">var</span> weather_info = Java.cast(response.data.value, Java.use(<span class="string">&quot;com.xhey.xcamera.data.model.bean.WeatherInfo&quot;</span>))</span><br><span class="line">            <span class="comment">// 对值做修改</span></span><br><span class="line">            weather_info.temperature.value = Java.use(<span class="string">&quot;java.lang.String&quot;</span>).$new(<span class="string">&quot;-99&quot;</span>);</span><br><span class="line">            <span class="comment">//</span></span><br><span class="line"></span><br><span class="line">            <span class="comment">// console.log(&quot;BaseResponse.code&quot;, response.code.value);</span></span><br><span class="line">            <span class="comment">// console.log(&quot;weather_info&quot;, gson.$new().toJson(weather_info));</span></span><br><span class="line">            <span class="comment">// console.log(&quot;BaseResponse.msg&quot;, response.msg.value);</span></span><br><span class="line">            <span class="comment">// console.log(&quot;BaseResponse.toast_msg&quot;, response.toast_msg.value);</span></span><br><span class="line"></span><br><span class="line">            <span class="keyword">var</span> result = clazz.a.apply(<span class="built_in">this</span>, <span class="built_in">arguments</span>);</span><br><span class="line">            <span class="keyword">return</span> result;</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;);</span><br><span class="line"></span><br><span class="line">    Java.perform(<span class="function"><span class="keyword">function</span> (<span class="params"></span>) </span>&#123;</span><br><span class="line">        Java.openClassFile(<span class="string">&quot;/data/local/tmp/r0gson.dex&quot;</span>).load();</span><br><span class="line">        <span class="keyword">const</span> gson = Java.use(<span class="string">&#x27;com.r0ysue.gson.Gson&#x27;</span>);</span><br><span class="line">        <span class="comment">/**</span></span><br><span class="line"><span class="comment">         * 解析时间 /next/inchina</span></span><br><span class="line"><span class="comment">         *      public class TimeStatus &#123;</span></span><br><span class="line"><span class="comment">         *      private boolean in_china;   // 是否在中国：true</span></span><br><span class="line"><span class="comment">         *      private boolean stopDevice; // false</span></span><br><span class="line"><span class="comment">         *      private int timestamp;      // 时间戳</span></span><br><span class="line"><span class="comment">         * &#125;</span></span><br><span class="line"><span class="comment">         */</span></span><br><span class="line">        <span class="keyword">var</span> clazz = Java.use(<span class="string">&#x27;com.xhey.xcamera.e$8&#x27;</span>);</span><br><span class="line">        clazz.a.implementation = <span class="function"><span class="keyword">function</span> (<span class="params">response_argu</span>) </span>&#123;</span><br><span class="line">            <span class="keyword">var</span> response = Java.cast(response_argu, Java.use(<span class="string">&quot;xhey.com.network.model.BaseResponse&quot;</span>));</span><br><span class="line">            <span class="keyword">var</span> time_info = Java.cast(response.data.value, Java.use(<span class="string">&quot;com.xhey.xcamera.data.model.bean.TimeStatus&quot;</span>));</span><br><span class="line">            </span><br><span class="line">            <span class="comment">// console.log(&quot;=== TIME ===&quot;)</span></span><br><span class="line">            <span class="comment">// console.log(&quot;BaseResponse.code&quot;, response.code.value);</span></span><br><span class="line">            <span class="comment">// console.log(&quot;BaseResponse.data&quot;, response.data.value);</span></span><br><span class="line">            <span class="comment">// console.log(&quot;BaseResponse.msg&quot;, response.msg.value);</span></span><br><span class="line">            <span class="comment">// console.log(&quot;BaseResponse.toast_msg&quot;, response.toast_msg.value);</span></span><br><span class="line">            <span class="comment">// console.log(&quot;Time&quot;, gson.$new().toJson(time_info));</span></span><br><span class="line"></span><br><span class="line">            <span class="comment">// console.log(&quot;TimeStatus.timestamp&quot;, time_info.timestamp.value);</span></span><br><span class="line"></span><br><span class="line">            time_info.timestamp.value = Java.use(<span class="string">&quot;java.lang.Integer&quot;</span>).$new(<span class="string">&quot;1912521600&quot;</span>).intValue();</span><br><span class="line"></span><br><span class="line">            <span class="keyword">var</span> result = clazz.a.apply(<span class="built_in">this</span>, <span class="built_in">arguments</span>);</span><br><span class="line">            <span class="keyword">return</span> result;</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;);</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">    Java.perform(<span class="function"><span class="keyword">function</span> (<span class="params"></span>) </span>&#123;</span><br><span class="line">        <span class="keyword">var</span> clazz = Java.use(<span class="string">&#x27;com.baidu.location.BDLocation&#x27;</span>);</span><br><span class="line">        <span class="comment">// 纬度</span></span><br><span class="line">        clazz.getLatitude.implementation = <span class="function"><span class="keyword">function</span> (<span class="params"></span>) </span>&#123;</span><br><span class="line">            <span class="keyword">var</span> result = clazz.getLatitude.apply(<span class="built_in">this</span>, <span class="built_in">arguments</span>);</span><br><span class="line">            <span class="comment">// console.log(&quot;Latitude&quot;, result);</span></span><br><span class="line"></span><br><span class="line">            result = Java.use(<span class="string">&quot;java.lang.Double&quot;</span>).$new(<span class="string">&quot;36.269893&quot;</span>).doubleValue();</span><br><span class="line">            <span class="comment">// console.log(&quot;Change Latitude&quot;, result);</span></span><br><span class="line"></span><br><span class="line">            <span class="keyword">return</span> result;</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="comment">// 经度</span></span><br><span class="line">        clazz.getLongitude.implementation = <span class="function"><span class="keyword">function</span> (<span class="params"></span>) </span>&#123;</span><br><span class="line">            <span class="keyword">var</span> result = clazz.getLongitude.apply(<span class="built_in">this</span>, <span class="built_in">arguments</span>);</span><br><span class="line">            <span class="comment">// console.log(&quot;Longitude&quot;, result);</span></span><br><span class="line"></span><br><span class="line">            result = Java.use(<span class="string">&quot;java.lang.Double&quot;</span>).$new(<span class="string">&quot;117.094738&quot;</span>).doubleValue();</span><br><span class="line">            <span class="comment">// console.log(&quot;Change Longitude&quot;, result);</span></span><br><span class="line"></span><br><span class="line">            <span class="keyword">return</span> result;</span><br><span class="line">        &#125;</span><br><span class="line"></span><br><span class="line">        <span class="comment">// 速度</span></span><br><span class="line">        clazz.getSpeed.implementation = <span class="function"><span class="keyword">function</span> (<span class="params"></span>) </span>&#123;</span><br><span class="line">            <span class="keyword">var</span> result = clazz.getSpeed.apply(<span class="built_in">this</span>, <span class="built_in">arguments</span>);</span><br><span class="line">            <span class="comment">// console.log(&quot;Speed&quot;, result);</span></span><br><span class="line"></span><br><span class="line">            result = Java.use(<span class="string">&quot;java.lang.Float&quot;</span>).$new(<span class="string">&quot;99.99&quot;</span>).floatValue();</span><br><span class="line">            <span class="comment">// console.log(&quot;Change Speed&quot;, result);</span></span><br><span class="line"></span><br><span class="line">            <span class="keyword">return</span> result;</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;);</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">function</span> <span class="title">func</span>(<span class="params"></span>) </span>&#123;</span><br><span class="line"></span><br><span class="line">    Java.perform(<span class="function"><span class="keyword">function</span> (<span class="params"></span>) </span>&#123;</span><br><span class="line">        <span class="keyword">var</span> clazz = Java.use(<span class="string">&#x27;xhey.com.network.retrofit2.AESUtil&#x27;</span>);</span><br><span class="line">        clazz.decrypt.implementation = <span class="function"><span class="keyword">function</span> (<span class="params">data</span>) </span>&#123;</span><br><span class="line"></span><br><span class="line">            <span class="keyword">var</span> result = clazz.decrypt.apply(<span class="built_in">this</span>, <span class="built_in">arguments</span>)</span><br><span class="line"></span><br><span class="line">            printStack(<span class="string">&quot;AES decrypt&quot;</span>);</span><br><span class="line">            <span class="built_in">console</span>.log(<span class="string">&quot;aes decrypt data:&quot;</span>, data);</span><br><span class="line">            <span class="built_in">console</span>.log(<span class="string">&quot;aes decrypt result: &quot;</span>, result);</span><br><span class="line"></span><br><span class="line">            <span class="keyword">return</span> result;</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;);</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">    Java.perform(<span class="function"><span class="keyword">function</span> (<span class="params"></span>) </span>&#123;</span><br><span class="line">        <span class="keyword">var</span> clazz = Java.use(<span class="string">&#x27;xhey.com.network.retrofit2.AESUtil&#x27;</span>);</span><br><span class="line">        clazz.encrypt.implementation = <span class="function"><span class="keyword">function</span> (<span class="params">data</span>) </span>&#123;</span><br><span class="line"></span><br><span class="line">            <span class="keyword">var</span> result = clazz.encrypt.apply(<span class="built_in">this</span>, <span class="built_in">arguments</span>)</span><br><span class="line"></span><br><span class="line">            printStack(<span class="string">&quot;AES encrypt&quot;</span>);</span><br><span class="line">            <span class="built_in">console</span>.log(<span class="string">&quot;aes encrypt data:&quot;</span>, data);</span><br><span class="line">            <span class="built_in">console</span>.log(<span class="string">&quot;aes encrypt result: &quot;</span>, result);</span><br><span class="line"></span><br><span class="line">            <span class="keyword">return</span> result;</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;);</span><br><span class="line">&#125;</span><br><span class="line">setImmediate(main)</span><br></pre></td></tr></table></figure>
<h3 id="Xposed插件开发">Xposed插件开发<a class="header-anchor" href="#Xposed插件开发"> ¶ </a></h3>
<p>hook的类已经分析完了，懒得造轮子了</p>
<h2 id="效果图-2">效果图<a class="header-anchor" href="#效果图-2"> ¶ </a></h2>
<p><img src= "" data-lazy-src="/AndroidReverse/2021/Crack_com.xhey.xcamera/image-20210810022207796.png" alt="image-20210810022207796"></p>
<h2 id="总结">总结<a class="header-anchor" href="#总结"> ¶ </a></h2>
<p>这算是自己分析的第一个app。花了差不多一天的时间，第一次接触这么大的代码量，刚开始有些懵逼。</p>
<p>但分析完发现这个app还是很简单的，没有壳也没有混淆，比较适合我这样的新手。</p>
<p>Frida啥的还是不熟练，疯狂找bug。</p>
<p>刚开始修改时间没有效果，最后发现是因为先执行了原方法<code>result = clazz.a.apply(this, arguments);</code>，导致时间在方法体内被直接应用了。</p>
</article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">文章作者: </span><span class="post-copyright-info"><a href="mailto:undefined">Forgo7ten</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">文章链接: </span><span class="post-copyright-info"><a href="https://forgo7ten.github.io/AndroidReverse/2021/Crack_com.xhey.xcamera/">https://forgo7ten.github.io/AndroidReverse/2021/Crack_com.xhey.xcamera/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="https://Forgo7ten.github.io" target="_blank">Forgo7ten'blog</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/tags/Android%E9%80%86%E5%90%91/">Android逆向</a></div><div class="post_share"><div class="social-share" data-image="http://forgo7ten.gitee.io/store/imgs/17.jpg" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/social-share.js/dist/css/share.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/social-share.js/dist/js/social-share.min.js" defer></script></div></div><div class="post-reward"><div class="reward-button"><i class="fas fa-qrcode"></i> 打赏</div><div class="reward-main"><ul class="reward-all"><li class="reward-item"><a href="/images/wechat.png" target="_blank"><img class="post-qr-code-img" src="/images/wechat.png" alt="wechat"/></a><div class="post-qr-code-desc">wechat</div></li><li class="reward-item"><a href="/images/alipay.jpg" target="_blank"><img class="post-qr-code-img" src="/images/alipay.jpg" alt="alipay"/></a><div class="post-qr-code-desc">alipay</div></li></ul></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/AndroidReverse/2021/Edit_the_Android_image_boot.img/"><img class="prev-cover" src="http://forgo7ten.gitee.io/store/imgs/12.jpg" onerror="onerror=null;src='/img/404.jpg'" alt="cover of previous post"><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">编辑Android镜像boot.img修改全局可调试</div></div></a></div><div class="next-post pull-right"><a href="/AndroidReverse/2021/Analysis_of_WeChat/"><img class="next-cover" src="http://forgo7ten.gitee.io/store/imgs/18.jpg" onerror="onerror=null;src='/img/404.jpg'" alt="cover of next post"><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">vx逆向分析随笔</div></div></a></div></nav><div class="relatedPosts"><div class="headline"><i class="fas fa-thumbs-up fa-fw"></i><span>相关推荐</span></div><div class="relatedPosts-list"><div><a href="/AndroidReverse/2021/Analysis_of_WeChat/" title="vx逆向分析随笔"><img class="cover" src="http://forgo7ten.gitee.io/store/imgs/18.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2021-08-14</div><div class="title">vx逆向分析随笔</div></div></a></div><div><a href="/AndroidReverse/2022/Android_dynamic_debugging_collection/" title="Android APK无源码动态调试合集"><img class="cover" src="http://forgo7ten.gitee.io/store/imgs/3.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2022-01-21</div><div class="title">Android APK无源码动态调试合集</div></div></a></div><div><a href="/AndroidReverse/2021/Initial_xposed_module_development/" title="Xposed 模块开发一 环境搭建"><img class="cover" src="http://forgo7ten.gitee.io/store/imgs/11.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2021-07-12</div><div class="title">Xposed 模块开发一 环境搭建</div></div></a></div><div><a href="/AndroidReverse/2022/Frida_all_in_one/" title="Frida all in one"><img class="cover" src="http://forgo7ten.gitee.io/store/imgs/14.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2022-04-23</div><div class="title">Frida all in one</div></div></a></div><div><a href="/AndroidReverse/2022/Learning_about_cryptographic_algorithms/" title="对加密算法的学习"><img class="cover" src="http://forgo7ten.gitee.io/store/imgs/18.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2022-02-07</div><div class="title">对加密算法的学习</div></div></a></div><div><a href="/AndroidReverse/2022/Android_devices_init/" title="Android刷机记录"><img class="cover" src="http://forgo7ten.gitee.io/store/imgs/13.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2022-05-03</div><div class="title">Android刷机记录</div></div></a></div></div></div><hr/><div id="post-comment"><div class="comment-head"><div class="comment-headline"><i class="fas fa-comments fa-fw"></i><span> 评论</span></div></div><div class="comment-wrap"><div><div id="gitalk-container"></div></div></div></div></div><div class="aside-content" id="aside-content"><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span><span class="toc-percentage"></span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#%E4%BB%8A%E6%97%A5%E6%B0%B4%E5%8D%B0%E7%9B%B8%E6%9C%BA%E8%87%AA%E5%AE%9A%E4%B9%89%E6%B0%B4%E5%8D%B0"><span class="toc-number">1.</span> <span class="toc-text">今日水印相机自定义水印</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%8A%93%E5%8C%85"><span class="toc-number">1.1.</span> <span class="toc-text">抓包</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E9%80%86%E5%90%91%E5%88%86%E6%9E%90"><span class="toc-number">1.2.</span> <span class="toc-text">逆向分析</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%88%86%E6%9E%90%E5%A4%A9%E6%B0%94%E5%8F%82%E6%95%B0%E7%9A%84%E8%8E%B7%E5%8F%96"><span class="toc-number">1.2.1.</span> <span class="toc-text">分析天气参数的获取</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#jeb%E5%88%86%E6%9E%90"><span class="toc-number">1.2.1.1.</span> <span class="toc-text">jeb分析</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E8%B0%83%E8%AF%95%E9%AA%8C%E8%AF%81"><span class="toc-number">1.2.1.2.</span> <span class="toc-text">调试验证</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%88%86%E6%9E%90%E6%97%B6%E9%97%B4%E7%9A%84%E8%8E%B7%E5%8F%96"><span class="toc-number">1.2.2.</span> <span class="toc-text">分析时间的获取</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%88%86%E6%9E%90%E5%AE%9A%E4%BD%8D"><span class="toc-number">1.2.3.</span> <span class="toc-text">分析定位</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%8F%92%E4%BB%B6%E7%BC%96%E5%86%99"><span class="toc-number">1.3.</span> <span class="toc-text">插件编写</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#Frida-hook%E8%84%9A%E6%9C%AC"><span class="toc-number">1.3.1.</span> <span class="toc-text">Frida hook脚本</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#Xposed%E6%8F%92%E4%BB%B6%E5%BC%80%E5%8F%91"><span class="toc-number">1.3.2.</span> <span class="toc-text">Xposed插件开发</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%95%88%E6%9E%9C%E5%9B%BE-2"><span class="toc-number">1.4.</span> <span class="toc-text">效果图</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%80%BB%E7%BB%93"><span class="toc-number">1.5.</span> <span class="toc-text">总结</span></a></li></ol></li></ol></div></div></div></div></main><footer id="footer" style="background-image: url('http://forgo7ten.gitee.io/store/imgs/17.jpg')"><div id="footer-wrap"><div class="copyright">&copy;2020 - 2023 By Forgo7ten</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div><div class="footer_custom_text">Hi, welcome to my <a href="https://Forgo7ten.github.io/">blog</a>!</div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="translateLink" type="button" title="简繁转换">繁</button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><a id="to_comment" href="#post-comment" title="直达评论"><i class="fas fa-comments"></i></a><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div id="local-search"><div class="search-dialog"><nav class="search-nav"><span class="search-dialog-title">本地搜索</span><span id="loading-status"></span><button class="search-close-button"><i class="fas fa-times"></i></button></nav><div class="is-center" id="loading-database"><i class="fas fa-spinner fa-pulse"></i><span>  数据库加载中</span></div><div class="search-wrap"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章" type="text"/></div></div><hr/><div id="local-search-results"></div></div></div><div id="search-mask"></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="/js/tw_cn.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.umd.js"></script><script src="https://cdn.jsdelivr.net/npm/instant.page/instantpage.min.js" type="module"></script><script src="https://cdn.jsdelivr.net/npm/vanilla-lazyload/dist/lazyload.iife.min.js"></script><script src="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.js"></script><script src="/js/search/local-search.js"></script><script>var preloader = {
  endLoading: () => {
    document.body.style.overflow = 'auto';
    document.getElementById('loading-box').classList.add("loaded")
  },
  initLoading: () => {
    document.body.style.overflow = '';
    document.getElementById('loading-box').classList.remove("loaded")

  }
}
window.addEventListener('load',preloader.endLoading())</script><div class="js-pjax"><script>function addGitalkSource () {
  const ele = document.createElement('link')
  ele.rel = 'stylesheet'
  ele.href= 'https://cdn.jsdelivr.net/npm/gitalk/dist/gitalk.min.css'
  document.getElementsByTagName('head')[0].appendChild(ele)
}

function loadGitalk () {
  function initGitalk () {
    var gitalk = new Gitalk(Object.assign({
      clientID: '9e01c692fcf5a9e47867',
      clientSecret: '6d5297eda0643a171a9e5510f5ea1c29ad851389',
      repo: 'Forgo7ten.github.io',
      owner: 'Forgo7ten',
      admin: ['Forgo7ten'],
      id: 'ada23a556b01d5329cab16a7191bcb3e',
      updateCountCallback: commentCount
    },{"language":"en","perPage":20,"distractionFreeMode":true,"pagerDirection":"last","createIssueManually":true}))

    gitalk.render('gitalk-container')
  }

  if (typeof Gitalk === 'function') initGitalk()
  else {
    addGitalkSource()
    getScript('https://cdn.jsdelivr.net/npm/gitalk@latest/dist/gitalk.min.js').then(initGitalk)
  }
}

function commentCount(n){
  let isCommentCount = document.querySelector('#post-meta .gitalk-comment-count')
  if (isCommentCount) {
    isCommentCount.innerHTML= n
  }
}

if ('Gitalk' === 'Gitalk' || !false) {
  if (false) btf.loadComment(document.getElementById('gitalk-container'), loadGitalk)
  else loadGitalk()
} else {
  function loadOtherComment () {
    loadGitalk()
  }
}</script></div><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/activate-power-mode.min.js"></script><script>POWERMODE.colorful = true;
POWERMODE.shake = true;
POWERMODE.mobile = false;
document.body.addEventListener('input', POWERMODE);
</script><script id="click-show-text" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/click-show-text.min.js" data-mobile="false" data-text="ヾ(≧▽≦*)o 点个收藏叭,(*^▽^*),w(ﾟДﾟ)w,ㄟ(≧◇≦)ㄏ,(/≧▽≦)/点个关注叭,Σ(っ °Д °;)っ,(●ˇ∀ˇ●),( •̀ ω •́ )✧,(*/ω＼*),ヽ(*。&gt;Д&lt;)o゜真的不收藏一下嘛,(～o￣3￣)～,ヽ（≧□≦）ノ" data-fontsize="15px" data-random="false" async="async"></script><script src="https://cdn.jsdelivr.net/npm/pjax/pjax.min.js"></script><script>let pjaxSelectors = ["title","#config-diff","#body-wrap","#rightside-config-hide","#rightside-config-show",".js-pjax"]

var pjax = new Pjax({
  elements: 'a:not([target="_blank"])',
  selectors: pjaxSelectors,
  cacheBust: false,
  analytics: false,
  scrollRestoration: false
})

document.addEventListener('pjax:send', function () {

  // removeEventListener scroll 
  window.tocScrollFn && window.removeEventListener('scroll', window.tocScrollFn)
  window.scrollCollect && window.removeEventListener('scroll', scrollCollect)

  typeof preloader === 'object' && preloader.initLoading()
  document.getElementById('rightside').style.cssText = "opacity: ''; transform: ''"
  
  if (window.aplayers) {
    for (let i = 0; i < window.aplayers.length; i++) {
      if (!window.aplayers[i].options.fixed) {
        window.aplayers[i].destroy()
      }
    }
  }

  typeof typed === 'object' && typed.destroy()

  //reset readmode
  const $bodyClassList = document.body.classList
  $bodyClassList.contains('read-mode') && $bodyClassList.remove('read-mode')

})

document.addEventListener('pjax:complete', function () {
  window.refreshFn()

  document.querySelectorAll('script[data-pjax]').forEach(item => {
    const newScript = document.createElement('script')
    const content = item.text || item.textContent || item.innerHTML || ""
    Array.from(item.attributes).forEach(attr => newScript.setAttribute(attr.name, attr.value))
    newScript.appendChild(document.createTextNode(content))
    item.parentNode.replaceChild(newScript, item)
  })

  GLOBAL_CONFIG.islazyload && window.lazyLoadInstance.update()

  typeof chatBtnFn === 'function' && chatBtnFn()
  typeof panguInit === 'function' && panguInit()

  // google analytics
  typeof gtag === 'function' && gtag('config', '', {'page_path': window.location.pathname});

  // baidu analytics
  typeof _hmt === 'object' && _hmt.push(['_trackPageview',window.location.pathname]);

  typeof loadMeting === 'function' && document.getElementsByClassName('aplayer').length && loadMeting()

  // prismjs
  typeof Prism === 'object' && Prism.highlightAll()

  typeof preloader === 'object' && preloader.endLoading()
})

document.addEventListener('pjax:error', (e) => {
  if (e.request.status === 404) {
    pjax.loadUrl('/404.html')
  }
})</script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div><script src="/live2dw/lib/L2Dwidget.min.js?094cbace49a39548bed64abff5988b05"></script><script>L2Dwidget.init({"pluginRootPath":"live2dw/","pluginJsPath":"lib/","pluginModelPath":"assets/","tagMode":false,"debug":false,"model":{"scale":1,"hHeadPos":0.5,"vHeadPos":0.618,"jsonPath":"/live2dw/assets/z16.model.json"},"display":{"superSample":2,"width":200,"height":400,"position":"right","hOffset":0,"vOffset":-20},"mobile":{"show":true,"scale":0.5},"react":{"opacityDefault":0.7,"opacityOnHover":0.2},"log":false});</script></body></html>